//
//  UIView+AFF.h
//  AnyfishApp
//
//  Created by Bob Lee on 15/11/20.
//  Copyright © 2015年 Anyfish. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AFFData.h"

@interface UIView (AFF)

@property (nonatomic, strong) AFFData *aData;    ///< 携带的数据

@property (nonatomic, assign) BOOL isLoading;    ///< 是否正在刷新加载数据;

- (void)removeAllSubView;
- (void)removeSubViewWithClass:(Class)cls;
- (void)removeSubViewWithTag:(NSInteger)tag;
- (void)removeAllSubLayer;

/**
 *  设置部分圆角(绝对布局)
 *
 *  @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
 *  @param radii   需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
 */
- (void)addRoundedCorners:(UIRectCorner)corners
                withRadii:(CGSize)radii;
/**
 *  设置部分圆角(相对布局)
 *
 *  @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
 *  @param radii   需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
 *  @param rect    需要设置的圆角view的rect
 */
- (void)addRoundedCorners:(UIRectCorner)corners
                withRadii:(CGSize)radii
                 viewRect:(CGRect)rect;

/**
 *  进度条view
 */
+ (UIView *)progressViewWithFrame:(CGRect)frame
                          persent:(CGFloat)persent
                          bgColor:(UIColor *)bgColor
                         proColor:(UIColor *)proColor
                           cornor:(CGFloat)cornor
                           direct:(BOOL)isHorizontal;

+ (instancetype)mh_viewFromXib;
@end
